package cn.schoolwow.workflow.entity;

import cn.schoolwow.quickdao.annotation.*;
import com.alibaba.fastjson.JSONObject;

import java.time.LocalDateTime;

@Comment("工作流任务列表")
public class WorkFlowTask {
    @Id
    private long id;

    @Comment("工作流实例id")
    @Constraint(notNull = true)
    @ForeignKey(table = WorkFlowInstance.class)
    private long instanceId;

    @Comment("节点id")
    @Constraint(notNull = true)
    @ForeignKey(table = WorkFlowNode.class)
    private long nodeId;

    @Comment("任务名称")
    private String taskName;

    @Comment("分配人")
    private String assigner;

    @Comment("分配人组序号")
    private Integer assignerGroupIndex;

    @Comment("是否已完成")
    @Constraint(notNull = true)
    private boolean complete;

    @Comment("任务类型(0:审批任务,1:前加签任务,2:后加签任务)")
    private Integer type;

    @Comment("是否隐藏任务")
    @Constraint(notNull = true, defaultValue = "0")
    private boolean hidden;

    @Comment("元数据")
    private JSONObject mata;

    @TableField(createdAt = true)
    private LocalDateTime createdAt;

    @TableField(updatedAt = true)
    private LocalDateTime updatedAt;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public long getInstanceId() {
        return instanceId;
    }

    public void setInstanceId(long instanceId) {
        this.instanceId = instanceId;
    }

    public long getNodeId() {
        return nodeId;
    }

    public void setNodeId(long nodeId) {
        this.nodeId = nodeId;
    }

    public String getTaskName() {
        return taskName;
    }

    public void setTaskName(String taskName) {
        this.taskName = taskName;
    }

    public String getAssigner() {
        return assigner;
    }

    public void setAssigner(String assigner) {
        this.assigner = assigner;
    }

    public Integer isAssignerIndex() {
        return assignerGroupIndex;
    }

    public void setAssignerGroupIndex(Integer assignerGroupIndex) {
        this.assignerGroupIndex = assignerGroupIndex;
    }

    public boolean isComplete() {
        return complete;
    }

    public void setComplete(boolean complete) {
        this.complete = complete;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public boolean isHidden() {
        return hidden;
    }

    public void setHidden(boolean hidden) {
        this.hidden = hidden;
    }

    public JSONObject getMata() {
        return mata;
    }

    public void setMata(JSONObject mata) {
        this.mata = mata;
    }

    public LocalDateTime getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(LocalDateTime createdAt) {
        this.createdAt = createdAt;
    }

    public LocalDateTime getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(LocalDateTime updatedAt) {
        this.updatedAt = updatedAt;
    }
}
